<template>
	<view class="noticeLayout">
		<view class="title">
			<view class="tag" v-if="detail.select">
				<uni-tag text="置顶" type="error" inverted 	></uni-tag>
			</view>
			<view class="font">{{detail.title}}</view>
		</view>
		<view class="info">
			<view class="item">{{detail.author}}</view>
			<view class="item">
					 <uni-dateformat :date="detail.publish_date" ></uni-dateformat>
			</view>
			
		</view>
		<view class="content">
			<!-- 内容区域 -->
			<mp-html :content="detail.content" />
			
		</view>
		<view class="count">
			阅读量{{detail.view_count}}
		</view>
		<!-- <rich-text :nodes=""></rich-text> 是官网富文本组件，以上是插件市场的-->
		
		
	</view>
</template>

<script setup>
		import {apiGetNoticeDetail} from "@/api/api.js"
		const detail=ref({})
		
	onLoad((option)=>{
		getNoticeDetail(option.id)
		
	})
const getNoticeDetail=async(id)=>{
	let res=await apiGetNoticeDetail({"id":id})
	detail.value=res.data
	console.log('notice detail',res)
}
</script>

<style lang="scss" scoped >
	.noticeLayout{
		padding:30rpx;
		.title{
			font-size:40rpx;
			color:#111;
			line-height:1.6em;
			padding-bottom:30rpx;
			display:flex;
			.tag{
				transform: scale(0.8);
				transform-origin: left center;
				flex-shrink:0;
			}
			.font{
				padding-left:6rpx;
			}
			
		}
		
		.info{
			display:flex;
			align-items: center;
			color:#999;
			font-size:28rpx;
			.item{
				padding-right:20rpx;
			}
			
		}
		.content{
			padding:50rpx 0;
			
		}
		.count{
			color:#999;
			font-size:28rpx;
		}
	
	
	}

</style>
